package model

type UserTeam struct {
	*Model
	UserId   uint32 `gorm:"not null" json:"user_id"`
	TeamId   uint32 `gorm:"not null" json:"team_id"`
	IsActive bool   `gorm:"default:false" json:"is_active"` //是否激活
	Tag      string `json:"tag"`                            //标签
	UserMsg  string `json:"user_msg"`                       //加入团队时的说明描述
	TeamMsg  string `json:"team_msg"`                       //添加成员时的说明描述
}

type UserTeamUserListResponse struct {
	ID         uint32 `json:"id"`
	CreatedOn  uint64 `json:"created_on"`
	ModifiedOn uint64 `json:"modified_on"`
	IsActive   bool   `json:"is_active"`
	Tag        string `json:"tag"`
	UserId     uint32 `json:"user_id"`
	Name       string `json:"user_name"`
	UserMsg    string `json:"user_msg"`
}

type UserTeamTeamListResponse struct {
	ID         uint32 `json:"id"`
	CreatedOn  uint64 `json:"created_on"`
	ModifiedOn uint64 `json:"modified_on"`
	IsActive   bool   `json:"is_active"`
	TeamId     uint32 `json:"team_id"`
	Name       string `json:"team_name"`
	UserMsg    string `json:"user_msg"`
	TeamMsg    string `json:"team_msg"`
}

func (UserTeam) TableName() string {
	return "user_team"
}

type CreateUserTeamRequest struct {
	UserId  uint32 `form:"user_id" binding:"required,gte=1" json:"user_id"`
	TeamId  uint32 `form:"team_id" binding:"required,gte=1" json:"team_id"`
	UserMsg string `form:"user_msg" json:"user_msg"`
}

type UserTeamUserListRequest struct {
	TeamId uint32 `form:"team_id" binding:"required,gte=1" json:"team_id"`
}

type UserTeamTeamListRequest struct {
	UserId uint32 `form:"user_id" binding:"required,gte=1" json:"user_id"`
}

type UserTeamTeamListByTeamNameRequest struct {
	UserId   uint32 `form:"user_id" binding:"required,gte=1" json:"user_id"`
	TeamName string `form:"team_name" binding:"required" json:"team_name"`
}

type UserTeamAgreeRequest struct {
	ID     uint32 `form:"id" binding:"required,gte=1" json:"id"`
	UserId uint32 `form:"user_id" binding:"required,gte=1" json:"user_id"`
}

type UserTeamRefuseRequest struct {
	ID     uint32 `form:"id" binding:"required,gte=1" json:"id"`
	UserId uint32 `form:"user_id" binding:"required,gte=1" json:"user_id"`
}

type UserLeaveTeamRequest struct {
	UserId uint32 `form:"user_id" binding:"required,gte=1" json:"user_id"`
	TeamId uint32 `form:"team_id" binding:"required,gte=1" json:"team_id"`
}
